#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<algorithm>
#include<cstdio>

using namespace std;

const int N = 10001;

struct stu {
    int x;
    double y;
    string s;

    bool operator<(const stu& t)const
    {
        return x < t.x;
    }
}a[N];

int main()
{
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) cin >> a[i].x >> a[i].y >> a[i].s;
    sort(a, a + n);
    for (int i = 0; i < n; i++)
        printf("%d %.2lf %s\n", a[i].x, a[i].y, a[i].s.c_str());
    return 0;
}